package com.wsjj.yjh.server.impl;
import com.wsjj.yjh.bean.OfflineTable;
import com.wsjj.yjh.mapper.OfflineTableMapper;
import com.wsjj.yjh.server.OfflineTableServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Random;

@Service
public class OfflineTableServerImpl implements OfflineTableServer {

    @Autowired
    private OfflineTableMapper offlineTableMapper;


    @Override
    public OfflineTable selectById() {
        Integer coumt = offlineTableMapper.selectCoumt();
        Random random = new Random();
        int id = random.nextInt(coumt);

        return offlineTableMapper.selectById(id+1);
    }
}
